Skip to content

Fix indentation in exported markdown results#1693

Merged
shati-patel merged 2 commits intomainfrom
shati-patel/fix-md-indentation
Nov 2, 2022
Merged

Fix indentation in exported markdown results#1693
shati-patel merged 2 commits intomainfrom
shati-patel/fix-md-indentation

Conversation

@shati-patel
Copy link
Copy Markdown
Contributor

@shati-patel shati-patel commented Nov 1, 2022

This PR fixes the markdown export for remote query results. Previously, paths with more than 100 steps had their code snippets badly indented, which caused the markdown to render badly on GitHub Gists.

I've changed the indentation to match the length of the list number, and updated tests to check this variable indentation size.

Checklist

N/A - this is a private beta feature. See internal issue for more details!

  • CHANGELOG.md has been updated to incorporate all user visible changes made by this pull request.
  • Issues have been created for any UI or other user-facing changes made by this pull request.
  • [Maintainers only] If this pull request makes user-facing changes that require documentation changes, open a corresponding docs pull request in the github/codeql repo and add the ready-for-doc-review label there.

@shati-patel shati-patel marked this pull request as ready for review November 1, 2022 17:13
@shati-patel shati-patel requested a review from a team as a code owner November 1, 2022 17:13
Copy link
Copy Markdown
Member

@koesie10 koesie10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Do you think it might make sense to use code blocks using ``` as a future improvement?

@robertbrignull
Copy link
Copy Markdown
Contributor

Do you think it might make sense to use code blocks using ``` as a future improvement?

I believe the reason we don't use ``` is because we want to add styling within the code block to highlight a specific bit. The code blocks don't allow you to add extra styling within them, though they do give other benefits like syntax highlighting and avoiding markdown indentation weirdness like this.

@shati-patel
Copy link
Copy Markdown
Contributor Author

Thanks for the review, @koesie10

Do you think it might make sense to use code blocks using ``` as a future improvement?

I believe the reason we don't use ``` is because we want to add styling within the code block to highlight a specific bit. The code blocks don't allow you to add extra styling within them, though they do give other benefits like syntax highlighting and avoiding markdown indentation weirdness like this.

Indeed! We can't add HTML styling (such as <strong> tags) in a regular markdown code block 😢 Slightly annoying, but it was the best compromise we could find.

@shati-patel shati-patel merged commit bd1f6cf into main Nov 2, 2022
@shati-patel shati-patel deleted the shati-patel/fix-md-indentation branch November 2, 2022 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants